using Ln.Fram.Caching.FreeRedis;
using Ln.Rbac.Domain.Authorization;
using Ln.Rbac.Domain.Operlog;
using Ln.Rbac.Domain.Shared;
using Ln.Rbac.Domain.Shared.Options;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.SignalR;
using Volo.Abp.Caching;
using Volo.Abp.Domain;

namespace Ln.Rbac.Domain;

[DependsOn(
	typeof(LnRbacDomainSharedModule),
	typeof(LnFramCachingFreeRedisModule),
	typeof(AbpDddDomainModule),
	typeof(AbpAspNetCoreSignalRModule),
	typeof(AbpCachingModule))]
public class LnRbacDomainModule : AbpModule
{
	public override void ConfigureServices(ServiceConfigurationContext context)
	{
		var service = context.Services;
		var configuration = context.Services.GetConfiguration();
		service.AddControllers(options =>
		{
			options.Filters.Add<PermissionGlobalAttribute>();
			options.Filters.Add<OperLogGlobalAttribute>();
		});
		//配置阿里云短信
		Configure<AliyunOptions>(configuration.GetSection(nameof(AliyunOptions)));
	}
}